﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using LastoRevival.Website;
using LastoRevival.Website.Models;
using LastoRevival.Service.Contracts.Models;

public static class ProfileHelper
{
	public static SiteUserSettings UserSettings(this HtmlHelper helper)
	{
		var profile = helper.ViewData["UserSettings"];

		if (profile == null)
		{
			throw new Exception("User settings not set in controller.");
		}

		return ((SiteUserSettings)profile);
	}

	public static UserProfileDetails Profile(this HtmlHelper helper)
	{
		var profile = helper.ViewData["UserProfile"];

		if (profile == null)
		{
			throw new Exception("User profile not set in controller.");
		}

		return ((UserProfile)profile).Details;
	}

	public static bool IsAuthenticated(this HtmlHelper helper)
	{
		return (bool)helper.ViewData["IsAuthenticated"];
	}

}
